﻿<%@LANGUAGE="VBSCRIPT" %>
<HTML XMLNS="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>Admin Help Articles</TITLE>
<LINK HREF="UniversalStyleSheet.css" REL="stylesheet" TYPE="text/css" />
<SCRIPT TYPE="text/javascript">
function EditClick(){
	a=document.getElementById("Articles")
		
	selindex=a.selectedIndex;
	if (selindex != -1){
	window.frames["display"].location="AdminHelpArticlesDisplay.asp?mode=edit&id=" + a.options[selindex].value;
	}
	
}

function AddClick(){
	window.frames["display"].location="AdminHelpArticlesDisplay.asp"
}
</SCRIPT>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"></HEAD>

<BODY>
<TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="1" BGCOLOR="#006600" style="border-style:outset; border-width:thin">
  <TR>
    <TD WIDTH="26%" ALIGN="right" VALIGN="top" BGCOLOR="#FFFFFF">
	<SELECT NAME="Articles" SIZE="30" ID="Articles">
	<%
	set conn=server.CreateObject("adodb.connection")
	set rs=server.CreateObject("adodb.recordset")
	set rsa=server.CreateObject("adodb.recordset")
		
	filepath=server.MapPath("access/backend/help.mdb")
	conn.open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FilePath)
	sql="select * from HelpTopics where catagory='header'"
	rs.cursorlocation=3
	rs.open sql,conn,1,2
	rs.activeconnection=nothing
	rsa.cursorlocation=3
	do while not rs.eof
		header=rs("title")
		parentid=rs("id")
		response.Write("<option value='" & rs("id") & "'><b>●" & header & "</b></option>" & vbcrlf)
		rsa.open "select * from HelpTopics where parent=" & parentid,conn,1,2
		rsa.activeconnection=nothing
		rcnt=rsa.recordcount
		cnt=0
		do while not rsa.eof
			cnt=cnt+1
			article=rsa("title")
			if cnt=rcnt then
				char="&nbsp;&nbsp;└ "
			else
				char="&nbsp;&nbsp;├ "
			end if
			response.Write("<option value='" & rsa("id") & "'>" & char & article & "</option>" & vbcrlf)
			rsa.movenext
		loop
		rs.movenext
		rsa.close
	loop
	rs.close
	conn.close
	set rsa=nothing
	set rs=nothing
	set conn=nothing  
	%>
	</SELECT>
	<A HREF="AdminHelpArticlesDisplay.asp?mode=add" TARGET="display"><BR />
	<IMG SRC="Images/AddButton.png" ALT="Add" NAME="BtnAdd" WIDTH="60" HEIGHT="30" BORDER="0" ID="BtnAdd" onClick="AddClick()"/></A>    
	<IMG SRC="Images/EditButton.png" ALT="Edit" WIDTH="60" HEIGHT="30" onClick="EditClick()"/></TD>
    <TD WIDTH="74%" BGCOLOR="#FFFFFF">
	<IFRAME ID="display" NAME="display" WIDTH="550" HEIGHT="575" FRAMEBORDER="0" SRC="AdminHelpArticlesDisplay.asp" SCROLLING="no"></IFRAME>	</TD>
  </TR>
</TABLE>
</BODY>
</HTML>
